<?php
require_once ('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登陆</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<?php
if($_POST["submit2"]){
if(empty($_POST['user']))
	echo "<script>alert('帐号不能为空');location='login.php';</script>";
else if(empty($_POST['password']))
	echo "<script>alert('密码不能为空');location='login.php';</script>";
else{
$_SESSION['member']=$_POST['user'];
$sql="select * from where member values('','".$_POST['user']."','".md5($_POST['password'])."','".$_POST['name']."','".$_POST['sex']."','".$_POST['qq']."','".$_POST['phone']."','".$_POST['email']."')";
$result=mysql_query($sql)or die(mysql_error());
if($result)
echo "<script>alert('恭喜你登陆成功,马上进入主页面');location='my.php';</script>";
else
{
	echo "<script>alert('登陆失败');location='login.php';</script>";
	mysql_close();
}
	}
}
?>
</head>
<body>
<form action="" method="post" name="regform" onSubmit="return Checklogin();" style="margin-bottom:0px;">
<table width="350" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#B3B3B3">
  <tr>
    <td colspan="2" align="center" bgcolor="#EBEBEB" class="font">会员登陆</td>
  </tr>
    <tr>
      <td width="65" align="center" bgcolor="#FFFFFF" class="font">用户名:</td>
      <td width="262" bgcolor="#FFFFFF" class="font"><input name="user" type="text" id="user"></td>
    </tr>
    <tr>
      <td align="center" valign="top" bgcolor="#FFFFFF" class="font">密&nbsp;码:</td>
      <td bgcolor="#FFFFFF" class="font"><input name="password" type="password" id="name">        </td>
    </tr>
    <tr>
    <td colspan="2" align="center" valign="top" bgcolor="#FFFFFF" class="font"><input name="submit2" type="submit" value="会员登录"/>
        <a href='reg.php'>没有账号？立即注册...</a></td>
  </tr>
</table>
</form>
    
<table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="5"></td>
  </tr>
</table>
    
</body>
</html>